<template>
  <el-dialog
    @close="close"
    title="操作记录"
    :visible.sync="dialog"
    width="75%"
  >
    <el-table :data="tableData" class="perpie_flo perpie_flo2">
      <el-table-column  label="申请人" width="140">
        <template slot-scope="scop">
          {{scop.row.nickname}}&nbspID:{{scop.row.playerNo}}
        </template>
      </el-table-column>
      <el-table-column prop="createTime" label="申请时间" width="120"></el-table-column>

      <el-table-column  label="申请内容" width="80">
        <template slot-scope="scope">
        <el-tag type="success" size="mini" v-if="scope.row.kind === 0">入会申请</el-tag>
        <el-tag type="danger" size="mini" v-else-if="scope.row.kind === 1">退会申请</el-tag>
          <el-tag type="danger" size="mini" v-else-if="scope.row.kind === 2">踢出公会</el-tag>
        <el-tag type="danger" size="mini" v-else>未知</el-tag>
        </template>
      </el-table-column>

      <!--<el-table-column prop="reason" label="申请理由" width="80"></el-table-column>-->


      <el-table-column prop="updateTime" label="处理时间" width="80"></el-table-column>
      <el-table-column prop="name" label="处理人" width="140">
        <template slot-scope="scop">
          {{scop.row.operatorName}}&nbspID:{{scop.row.operator}}
        </template>
      </el-table-column>
      <el-table-column prop="address" label="处理结果" width="80">
        <template slot-scope="scope">
          <el-tag type="success" size="mini" v-if="scope.row.state === 1">通过</el-tag>
          <el-tag type="danger" size="mini" v-else-if="scope.row.state === 2">拒绝</el-tag>
          <el-tag type="danger" size="mini" v-else-if="scope.row.state === 3">自动通过</el-tag>
          <el-tag type="danger" size="mini" v-else>未知</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>

</template>
<script>
  import { getLogListAPI } from "@/api/user";
  export default {
    name: 'AddLabel',
    props: {
      dialog: {
        default: false,
        type: Boolean
      },
      name: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        dialog: true,
        btnLoading: false,  // 提交按钮状态
        formInline: {
          pageNum:1,
          pageSize:10
        },
        tableData:[]
      }
    },
    mounted() {
      this.getLogList()
      this.dialog = this.dialog
      if (this.name) {
      }else{

      }
    },
    methods: {

      getLogList() {
        this.loading = true
        getLogListAPI(this.formInline).then(res => {
          this.loading = false
          if (res.rtnInfo.code === 0) {
            this.tableData = res.rtnInfo.data.list
            this.formInline.total= res.rtnInfo.data.total;
          } else {
            this.$message.error(res.message)
          }
        })
      },
      // 关闭弹窗
      close() {
        this.$emit('close')
      },
      // 提交信息
      onSubmit() {
        debugger
        this.$emit('labelName',this.labelName)
        this.$emit('labelAttribute',this.label_list)
      },
    }
  }
</script>

<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .gameed_inpu{
    width:350px;
  }

</style>


